import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'image_logic.dart';

class ImagePage extends StatefulWidget {
  const ImagePage({Key? key}) : super(key: key);

  @override
  State<ImagePage> createState() => ImagePageState();
}

class ImagePageState extends State<ImagePage> {
  final logic = Get.put(ImageLogic());
  final state = Get.find<ImageLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          backgroundColor: Theme.of(context).colorScheme.inversePrimary,
          title: Text(state.title ?? ""),
        ),
        body: Align(
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.center,
            children: [
              /// 显示本地图片
              Image.asset("assets/images/image_bird.png",width: 200.w,height: 160.w,fit: BoxFit.contain),
              /// 显示网络图片
              Image.network("https://lmg.jj20.com/up/allimg/tp07/220412195113610-lp.jpg",width: 300.w,height: 400.w,fit: BoxFit.contain,)
            ],
          ),
        ) );
  }
}
